<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page import="order.OrderItem" %>
<%@ page import="order.OrderItemService" %>
<%@ page import="java.util.List" %>
<%@ page import="order.OrderService" %>
<%--<%@ page import="com.myUtil.ProcessUtil" %>--%>
<%@ page import="order.OrderItemService" %><%--
  Created by IntelliJ IDEA.
  User: huawei
  Date: 2022/10/22
  Time: 22:40
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
	<title>订单详情页</title>
	<!-- 新 Bootstrap5 核心 CSS 文件 -->
	<link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/5.1.1/css/bootstrap.min.css">
	<%--icon图标--%>
	<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.9.1/font/bootstrap-icons.css">
	<!--  popper.min.js 用于弹窗、提示、下拉菜单 -->
	<script src="https://cdn.staticfile.org/popper.js/2.9.3/umd/popper.min.js"></script>
	<!-- 最新的 Bootstrap5 核心 JavaScript 文件 -->
	<script src="https://cdn.staticfile.org/twitter-bootstrap/5.1.1/js/bootstrap.min.js"></script>
	<script type="text/javascript" src="script/jquery-3.6.0.min.js"></script>
</head>
<body>
<%
	OrderItemService orderItemService = new OrderItemService();

	String orderId = request.getParameter("1702747430576");
	List<OrderItem> orderItems = orderItemService.showAllOrderItem("1702747430576");
	if (orderItems !=null && orderItems.size()!=0){
		session.setAttribute("orderItems",orderItems);
	}
%>
<nav class="navbar-expand-lg navbar navbar-dark bg-primary">
	<div class="container-fluid ">
		<a class="navbar-brand" href="#">订单详情页</a>
		<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNavDropdown" aria-controls="navbarNavDropdown" aria-expanded="false" aria-label="Toggle navigation">
			<span class="navbar-toggler-icon"></span>
		</button>
		<div class="collapse navbar-collapse" id="navbarNavDropdown">
			<ul class="navbar-nav">
				<li class="nav-item">
					<a class="nav-link active" aria-current="page" href="first.jsp">Home</a>
				</li>
			</ul>
		</div>
	</div>
</nav>

	<div class="container">
		<div class="card">
			<table class="table table-hover text-center">
				<tr>
					<td>订单号</td>
					<td>商品名称</td>
					<td>价格</td>
					<td>数量</td>
					<td>总价格</td>
				</tr>
				<c:forEach items="${sessionScope.orderItems}" var="orderItem">
					<tr style="vertical-align: middle !important;text-align: center;">
						<td>${orderItem.order_id}</td>
						<td>
							<img style="width: 100px;height: 100px" src="${orderItem.img}"/>
							<span>${orderItem.name}</span>
						</td>
						<td>${orderItem.price}</td>
						<td>${orderItem.count}</td>
						<td>${orderItem.total_price}</td>
					</tr>
				</c:forEach>
			</table>

		</div>
	</div>

</body>
</html>
